package com.baor.controller;

import com.baor.service.CustomerService;
import com.baor.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    @RequestMapping("/deductPoints")
    public R deductUserPoints(@RequestBody Map<String, Object> params) {
        return customerService.deductPoints(params);
    }

    @RequestMapping("/helo")
    public String Hello(){
        return "customerhello";
    }



//    以下家豪
//  没有条件的查询 客户列表
@RequestMapping(value = "customerList")
public R customerList(@RequestBody Map<String, Object> params){
    R r = this.customerService.customerList(params);
    return r;
}
    ////  有条件的查询 用户列表
//    @RequestMapping(value = "customerList2")
//    public R cutomerList2(@RequestBody Map<String, Object> params){
//        R r = this.customerService.customerList2(params);
//        return r;
//    }
//  编辑用户
    @RequestMapping(value = "editCustomer")
    public Boolean editUser(@RequestBody Map<String, Object> params){

        return this.customerService.editUser(params);
    }


}